VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsTempTableGet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Public Function GetTempInfo(ByVal nTEMPSeqNum As Variant, _
                            ByRef nComID As Variant, _
                            ByRef nUserID As Variant, _
                            ByRef sMoreThanOne As Variant, _
                            ByRef sEmailTo As Variant, _
                            ByRef nIncomeTaxReferenceNo As Variant, _
                            ByRef sNoTaxRefNoRsn As Variant, _
                            ByRef sNoTaxRefNoText As Variant, _
                            ByRef nRSAID As Variant, _
                            ByRef sOtherID As Variant, _
                            ByRef sSurname As Variant, _
                            ByRef sFirstNames As Variant, _
                            ByRef sInitials As Variant, _
                            ByRef dtBirthDate As Variant, _
                            ByRef sHome1 As Variant, ByRef sHome2 As Variant, ByRef sHome3 As Variant, ByRef sHome4 As Variant, _
                            ByRef sHomeCode As Variant, _
                            ByRef sPost1, ByRef sPost2 As Variant, ByRef sPost3 As Variant, ByRef sPost4 As Variant, _
                            ByRef sPostCode As Variant, _
                            ByRef sFormType As Variant, _
                            ByRef nFundID As Variant, _
                            ByRef nEmpID As Variant)
                            'Optional ByRef nFundPAYERefNum As Variant)
    
    Dim cnGetTempTable As ADODB.Connection
    Dim rsHolder As ADODB.recordSet
    
    Dim strSQL As String
    
    Set cnGetTempTable = New ADODB.Connection
    Set rsHolder = New ADODB.recordSet
    
    
    Set cmd = CreateObject("ADODB.COMMAND")
    
    With cnGetTempTable
        .ConnectionString = GetConnectionString() 'Johann (20090625): Centralised code for connection string added
        .Open
    End With
    
    Dim sDateConvert As KeyTax.clsDateConvert
    Set sDateConvert = New KeyTax.clsDateConvert
    
    Dim dtStringDate
    
    cmd.CommandText = "dir_get_dir_temp_request"
    cmd.CommandType = adCmdStoredProc
    cmd.ActiveConnection = cnGetTempTable
    
        cmd.Parameters.Append cmd.CreateParameter("temp_seq_num", adDouble, adParamInput, , nTEMPSeqNum)
    
    On Error Resume Next
    
    Set rsHolder = cmd.Execute
    
    nComID = CStr(rsHolder("com_id"))
    nUserID = CStr(rsHolder("use_id"))
    sMoreThanOne = CStr(rsHolder("more_than_one"))
    sEmailTo = CStr(rsHolder("email_to"))
    nIncomeTaxReferenceNo = CStr(rsHolder("income_tax_reference_number"))
    If IsNull(rsHolder("no_tax_ref_no_rsn")) Then
        sNoTaxRefNoRsn = ""
    Else
         sNoTaxRefNoRsn = CStr(rsHolder("no_tax_ref_no_rsn"))
    End If
    If IsNull(rsHolder("no_tax_ref_no_text")) Then
        sNoTaxRefNoText = ""
    Else
        sNoTaxRefNoText = CStr(rsHolder("no_tax_ref_no_text"))
    End If
    nRSAID = CStr(rsHolder("rsa_id_number"))
    If IsNull(rsHolder("other_id_number")) Then
        sOtherID = ""
    Else
        sOtherID = CStr(rsHolder("other_id_number"))
    End If
    sSurname = CStr(rsHolder("surname"))
    sFirstNames = CStr(rsHolder("firstnames"))
    sInitials = CStr(rsHolder("initials"))
    dtBirthDate = CStr(rsHolder("birthdate"))
    sHome1 = CStr(rsHolder("home_addr_l1"))
    sHome2 = CStr(rsHolder("home_addr_l2"))
    If IsNull(rsHolder("home_addr_l3")) Then
        sHome3 = ""
    Else
        sHome3 = CStr(rsHolder("home_addr_l3"))
    End If
    If IsNull(rsHolder("home_addr_l4")) Then
        sHome4 = ""
    Else
        sHome4 = CStr(rsHolder("home_addr_l4"))
    End If
    sHomeCode = CStr(rsHolder("home_postal_code"))
    sPost1 = CStr(rsHolder("post_addr_l1"))
    sPost2 = CStr(rsHolder("post_addr_l2"))
    If IsNull(rsHolder("post_addr_l3")) Then
        sPost3 = ""
    Else
        sPost3 = CStr(rsHolder("post_addr_l3"))
    End If
    If IsNull(rsHolder("post_addr_l4")) Then
        sPost4 = ""
    Else
        sPost4 = CStr(rsHolder("post_addr_l4"))
    End If
    sPostCode = CStr(rsHolder("post_postal_code"))
    sFormType = CStr(rsHolder("scod_form_type"))
    If IsNull(rsHolder("fun_id")) Then
        nFundID = "0"
    Else
        nFundID = CStr(rsHolder("fun_id"))
    End If
    If IsNull(rsHolder("emp_id")) Then
        nEmpID = "0"
    Else
        nEmpID = CStr(rsHolder("emp_id"))
    End If
    
    'Tina: 2004/03/12 added
    'nFundPAYERefNum = CStr(rsHolder("fund_paye_ref_num"))
    'dtBirthDate = sDateConvert.DateTimeStampToStringDate(dtBirthDate)
    
    If rsHolder.EOF Then
        GetTempInfo = "The information that was temporarily stored, has been lost.  Please resubmit your request.  We apoligise for the inconvenience."
    End If
    
    Select Case Err.Number
        Case 0
            
        Case Else
            GetTempInfo = "WARNING: An error occured <br><br><b>Error Information</b> <br><br> Error Number: " & Err.Number & " <br><br> Error description: <br>" & Err.Description & ""
    End Select
    
    'clean up
    rsHolder.Close
    Set rsHolder = Nothing
    cnGetTempTable.Close
    Set cnGetTempTable = Nothing
    
    
End Function
